<template>
  <div class="hudong">
    <div class="hudong-title" v-for="item in title" :key="item.id">
      <img :src="item.imgurl" alt />
      <p class="title">{{item.title}}</p>
      <p class="text">{{item.text}}</p>
      <p class="info">
        <span class="time">{{item.time}}</span>
        <span class="read">{{item.read}}</span>
      </p>
    </div>
    <div class="hudong-list">
      <li v-for="item in list" :key="item.id">
        <img :src="item.imgurl" alt />
        <div>
          <p class="title">{{item.title}}</p>
          <div class="info">
            <span class="time">{{item.time}}</span>
            <p class="number">
              <img :src="item.eye" alt />
              <span>{{item.number}}</span>
            </p>
          </div>
        </div>
      </li>
    </div>
  </div>
</template>

<script>
import instance from "@/api/index"
export default {
  name:"hudong",
  data(){
    return {
      // hudong:null
      title:null,
      list:null
    }
  },
  methods:{
    async getHudong(){
      let {data} = await instance.get("/find");
      this.title = data.photo.title;
      this.list = data.photo.list;
    }
  },
  created(){
    this.getHudong();
  }
}
</script>

<style scoped>
li {
  list-style: none;
}
.hudong {
  box-sizing: border-box;
  width: 100%;
  padding: 20px 10px 0 10px;
}
.hudong-title img {
  width: 100%;
  height: 275px;
  border-radius: 10px;
}
.hudong-title p {
  box-sizing: border-box;
  width: 100%;
  font-size: 21px;
  display: flex;
  padding-left: 28px;
}
.hudong-title .title {
  font-size: 25px;
  color: #333;
  padding: 20px 0 10px 28px;
}
.hudong-title .text {
  box-sizing: border-box;
  padding-right: 28px;
  color: #666;
  line-height: 30px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.hudong-title .info {
  padding: 10px 28px 0 28px;
  color: #999;
  justify-content: space-between;
}
.hudong-list {
  padding-bottom: 20px;
}
.hudong-list li {
  box-sizing: border-box;
  height: 164px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
}
.hudong-list li > img {
  width: 266px;
  height: 100%;
}
.hudong-list li > div .title {
  box-sizing: border-box;
  font-size: 25px;
  padding: 15px 20px 0px;
  margin-bottom: 21px;

  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hudong-list li > div .info {
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  padding: 21px 30px 21px 20px;
  font-size: 21px;
  color: #b8b8b8;
}
.hudong-list li > div .info .number {
  display: flex;
  align-items: center;
}
.hudong-list li > div .info .number img {
  height: 30px;
  margin-right: 5px;
}
</style>